Field of the Invention
The present invention relates to a communication apparatus, a communication method, and a computer-readable storage medium.
Description of the Related Art
A wireless communication standard called Wi-Fi Direct® is known. Wi-Fi Direct is one of wireless communication standards (Wi-Fi) certified by Wi-Fi alliance, which enables a terminal to directly connect to another terminal to transmit/receive data without an access point used in a normal Wi-Fi connection method.
Wi-Fi Direct implements direct connection between electronic devices by defining a protocol for automatically deciding whether each electronic device operates as a wireless LAN access point or wireless LAN station, and eliminating the need for a conventional dedicated device as an access point. As a method of directly connecting terminals by a wireless LAN, there is an “ad hoc mode” in which terminals are connected to each other using a P2P (Peer to Peer) method, in addition to Wi-Fi Direct. The difference between Wi-Fi Direct and the ad hoc mode is as follows. That is, Wi-Fi Direct is a method in which any one of terminals implements the function of a wireless LAN access point (host device), and the ad hoc mode is a connection method which uses no access point.
Japanese Patent Laid-Open No. 2013-42400 describes a technique using Wi-Fi Direct. Japanese Patent Laid-Open No. 2013-42400 discloses a technique in which a PC wirelessly communicates with a printer using a Wi-Fi Direct function to transmit print data.
There are, for example, a plurality of print services using standards between an information processing apparatus and a printing apparatus. If, however, the services use the same communication protocol in a basic application layer, they also generally use the same default port number. This is because a destination port number is generally determined by IANA (Internet Assigned Numbers Authority).
If a plurality of print services use a common destination port number on the server side, it is impossible to discriminate differences in the print services which are derived from differences in the standards. For example, the following situation is considered:
Standard 1: communication protocol A, print data format B, rule D for a printing paper designation method; and
Standard 2: communication protocol A, print data format C, rule E for a printing paper designation method.
Note that since the transmission source port number of a client is automatically assigned on the client side, no such problem arises.
As shown in FIG. 15, for example, if print service 1 and print service 2 are executed between an information processing apparatus functioning as a client and a printing apparatus functioning as a server using the same communication protocol, the print services execute the same port (for example, a port number of 80).
As described above, if different print services share a single port, it may be impossible to correctly perform print processing in each print service. As a result, the user may not be able to obtain an intended printing result. This problem may also arise in cases other than those in which the destination of transmission data from a client to a server is specified by a port number (for example, a case in which the destination is specified by a URL or the like). Furthermore, this problem may arise in services other than print services.